package org.caro.utils;

public class Position {
	private int x;
	private int y;

	public Position(int x, int y) {
		this.x = x;
		this.y = y;
	}

	public Position(String s) {
		String token[] = s.split(" ");
		if (token.length == 2) {
			try {
				this.x = Integer.parseInt(token[0]);
				this.y = Integer.parseInt(token[1]);
			} catch (NumberFormatException nfe) {
				nfe.printStackTrace();
			}
		}
	}

	public int getX() {
		return x;
	}

	public int getY() {
		return y;
	}
	@Override
	public String toString(){
		return String.valueOf(x)+" "+String.valueOf(y);
	}
}
